#include <stdio.h>
#include <stdlib.h>
#include "avl.h"

int main(void)
{
        AVLTree avl;
        //datatype ar[] = {10, 20, 5, 30, 15, 25};      //测试左旋
        //datatype ar[] = {30, 20, 40, 10, 25, 15, 10}; //测试右旋
        //datatype ar[] = {50, 40, 60, 10, 45, 70, 5, 30, 20};  //测试先左后右旋
        datatype ar[] = {30, 20, 50, 10, 40, 70, 60, 80, 65}; //测试先右后左旋
        int n = sizeof(ar) / sizeof(datatype);

        InitAVLTree(&avl);
        for (int i = 0; i < n; i++)
                InsertAVLNode(&avl.root, &ar[i]);

        datatype key = 48;
        RemoveAVLTree(&avl.root, &key);

        exit(EXIT_SUCCESS);
}
